import { configureStore } from '@reduxjs/toolkit';
import authReducer from './authSlice';

// 配置Redux存储
export const store = configureStore({
  reducer: {
    auth: authReducer,
    // 在这里添加其他reducer
  },
  middleware: (getDefaultMiddleware) => 
    getDefaultMiddleware({
      serializableCheck: {
        // 忽略Redux中不可序列化的值检查（如果需要）
        ignoredActions: [],
        ignoredPaths: [],
      },
    }),
  devTools: import.meta.env.DEV, // 在开发环境启用Redux DevTools
});

// 定义并导出类型
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch; 